import request from '@/utils/request'

// 查询
export function getalertList(data) {
  return request({
    url: `/earlyWarning/page?limit=${data.limit}&page=${data.page}`,
    method: 'get'
  })
}

// 查询id和name
export function getIdandName() {
  return request({
    url: '/earlyWarning/getIdAndName',
    method: 'get'
  })
}

// 添加
export function addalertList(data) {
  return request({
    url: '/earlyWarning/insert',
    method: 'post',
    data
  })
}

// 删除
export function deletealertList(data) {
  return request({
    url: `/earlyWarning/deleteOne/${data.earlyWarningId}`,
    method: 'post'
  })
}

// 批量删除
export function deletealertLists(data) {
  return request({
    url: `/earlyWarning/deleteList?ids%5B%5D=${data.item}`,
    method: 'post'
  })
}

// 更新
export function updatealertList(data) {
  return request({
    url: '/earlyWarning/update',
    method: 'post',
    data
  })
}
